﻿
using Newtonsoft.Json;
using System.Text;
using TencentCloud.Privatedns.V20201028.Models;

namespace ZenSystemService.Api.Common.HttpCommunication
{
    public class HttpService : IHttpService
    {
        private readonly HttpClient _httpClient;
        public HttpService(HttpClient httpClient)
        {
            _httpClient = httpClient;
        }
        public async Task<HttpResponseMessage> PostAsync<T>(string url, T data)
        {
           var content = new StringContent(JsonConvert.SerializeObject(data),
               Encoding.UTF8,"application/json");
            return await _httpClient.PostAsync(url, content);
        }
    }
}
